const mongoose = require('mongoose');
const db = require('./db');

var userSchema = new mongoose.Schema({                   //（模式）数据类型  不是模型
    name: String,
    password: String,
    tx_url:String
})

userSchema.statics.denglu=function(obj,callback){          //这是静态方法
    return this.model('User').find({name:obj.name,password:obj.password},callback)
}
userSchema.statics.zhuce=function(obj,callback){            
    return this.model('User').find({name:obj.name},callback)
}

var User = mongoose.model('User', userSchema);                  //模型

module.exports = User